package chixing.day14.work;

import java.util.HashMap;
import java.util.Map;

public class Phone {
     static  Map <String, Long> phoneBook;
    static{
        phoneBook = new HashMap<>();
        phoneBook.put("Tom", 18627395555L);
        phoneBook.put("Jerry", 1923833333L);
        phoneBook.put("Alice", 13789439999L);
    }
    public static Long getPhoneNo(String userName){

        return phoneBook.get(userName);
    }
    public static void main(String[] args) {
        String[] testNames = {"Tom", "Jerry", "Alice", "Bob"};
        for (String name : testNames) {
            Long phoneNo = getPhoneNo(name);
            if (phoneNo != null) {
                System.out.println(name + ": " + phoneNo);
            } else {
                System.out.println("Not Found");
            }
        }
    }
}
